
package com.htd.htdapmcommon.enums;


public enum AlarmsLevelEnum {


	LEVEL_ONE("1","提醒"),
    LEVEL_TWO("2","警告"),
    LEVEL_THREE("3","严重");


	private String code;

	private String msg;

	private AlarmsLevelEnum(String code, String msg){
		this.code = code;
		this.msg = msg;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

    /**
     * 根据code获取去value
     * @param code
     * @return
     */
    public static String getValueByCode(String code){
        for(AlarmsLevelEnum alarmsLevelEnum:AlarmsLevelEnum.values()){
            if(code.equals(alarmsLevelEnum.getCode())) {
                return alarmsLevelEnum.getMsg();
            }
        }
        return null;
    }
}
